Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

Mail\Message::getSubject() should return value the way it was set #2334

Merged
merged 2 commits into from Sep 13, 2012
Merged

Mail\Message::getSubject() should return value the way it was set #2334

merged 2 commits into from Sep 13, 2012

Conversation

Xerkus
Copy link
Member

@Xerkus Xerkus commented Sep 10, 2012

Message return subject in encoded form which is quite unexpected behaviour for end user

$message->setSubject('Subject');
$message->setEncoding('UTF-8');
$message->getSubject(); // Subject
//before this PR:
$message->getSubject(); // =?UTF-8?Q?Subject?=

Transport should retrieve encoded Subject header value from headers and not directly from message object.

return null;
}
$header = $headers->get('subject');
return $header->getFieldValue(HeaderInterface::FORMAT_ENCODED);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this also be done for SMTP and/or File transports? or is it an issue only for the Sendmail transport?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Message::getSubject() was used only in sendmail.
I will check if getters for other properties proxied to Headers are used in transports and replace them with direct access too.

@ghost ghost assigned weierophinney Sep 13, 2012
@weierophinney weierophinney merged commit 45b4a39 into zendframework:master Sep 13, 2012
@weierophinney
Copy link
Member

Merged to master and release branches.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants